home *** CD-ROM | disk | FTP | other *** search
/ Adobe Graphics & Publishing SDK 1996 December / Adobe Graphics & Publishing SDK 1996 December.iso / pc / ps40sdk / examples / common / headers.h / pigeneral.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-10-14  |  24.4 KB  |  834 lines

  1. /*
  2.     File: PIGeneral.h
  3.  
  4.     Copyright (c) 1992-6, Adobe Systems Incorporated.
  5.     All rights reserved.
  6.  
  7.     This file describes the elements common to all plug-in interfaces.
  8. */
  9.  
  10. #ifndef __PIGeneral__
  11. #define __PIGeneral__
  12.  
  13. #include "PITypes.h"
  14.  
  15. #if PRAGMA_ALIGN_SUPPORTED
  16. #pragma options align=mac68k
  17. #endif
  18.  
  19. #if defined(__BORLANDC__)
  20. #pragma option -a-
  21. #endif
  22.  
  23. #if MSWindows
  24. /* The following macros are part of PIGeneral.r on the Mac. We need to have access  */
  25. /* to those macros in a header file. This file should be updated to reflect the     */
  26. /* changes made to PIGeneral.r.                                                        */
  27.  
  28. #define PIVersion "4.0"
  29. #define ProductVersion  3,0,0x86,4
  30.  
  31. #define supportsBitmap          1
  32. #define supportsGrayScale       2
  33. #define supportsIndexedColor    4
  34. #define supportsRGBColor        8
  35. #define supportsCMYKColor      16
  36. #define supportsHSLColor       32
  37. #define supportsHSBColor       64
  38. #define supportsMultichannel  128
  39. #define supportsDuotone       256
  40. #define supportsLABColor      512
  41.  
  42. #define latestAcquireVersion        4
  43. #define latestAcquireSubVersion     0
  44. #define latestExportVersion         4
  45. #define latestExportSubVersion      0
  46. #define latestExtensionVersion      1
  47. #define latestExtensionSubVersion   0
  48. #define latestFilterVersion         4
  49. #define latestFilterSubVersion      0
  50. #define latestFormatVersion         1
  51. #define latestFormatSubVersion      0
  52. #define latestParserVersion            1
  53. #define latestParserSubVersion        0
  54. #define latestSelectionVersion        1
  55. #define latestSelectionSubVersion    0
  56. #define latestPickerVersion            1
  57. #define latestPickerSubVersion        0
  58.  
  59. #endif
  60.  
  61. typedef unsigned long PIType;  /* this originally came from OSType on the Mac */
  62.  
  63. /********************************************************************************/
  64.  
  65. #define kPhotoshopSignature        0x3842494dL    /* '8BIM' <OSType. Photoshop application signature */
  66.  
  67. /********************************************************************************/
  68.  
  69. /* The following error codes are available for all plug-ins. */
  70.  
  71. #define errPlugInHostInsufficient            -30900
  72.         /* "the plug-in requires services not provided by this host." */
  73.  
  74. #define errPlugInPropertyUndefined            -30901
  75.         /* "a requested property could not be found. */
  76.  
  77. /*    
  78.     The following error code is specifically used for some of the image
  79.     processing operations to reflect whether the host supports colBytes values
  80.     other than 1.
  81. */
  82.         
  83. #define errHostDoesNotSupportColStep        -30902
  84.         /* "the plug-in requires services not provided by this host." */
  85.  
  86. #define errInvalidSamplePoint                -30903
  87.         /*    Returned from plugIncolorServicesSamplePoint to indicate point
  88.             is not in an image window.
  89.         */
  90.          
  91. #define errReportString                        -30904
  92.         /*    Plug-in can return this to notify the host to use the error
  93.              string for reporting.
  94.         */
  95.          
  96. /*    The following error numbers are used with the routines for working with
  97.     channel ports.
  98. */
  99.          
  100. #define errUnknownPort                        -30910
  101.  
  102. #define errUnsupportedRowBits                -30911
  103. #define errUnsupportedColBits                -30912
  104. #define errUnsupportedBitOffset                -30913
  105. #define errUnsupportedDepth                    -30914
  106.     /* We've never heard of this depth. */
  107. #define errUnsupportedDepthConversion         -30915
  108.     /* We've heard of this depth, but we aren't prepared to do the conversion. */
  109.  
  110. /* Errors used by the scripting system */
  111. #define errWrongPlatformFilePath             -30916
  112. #define errMissingParameter                    -1715        /* errAEParamMissed */
  113.  
  114. /********************************************************************************/
  115.  
  116. #define PIKindProperty            0x6b696e64L /* 'kind' <PIType> giving the plug-in's kind */
  117. #define PIVersionProperty        0x76657273L /* 'vers' <int32> Major<int16>.Minor<int16> version number. */
  118. #define PIPriorityProperty        0x70727479L /* 'prty' <int32> Load order priority */
  119. #define PIImageModesProperty    0x6d6f6465L /* 'mode' <FlagSet> Image modes supported flags. (bitmask) */
  120. #define PIEnableInfoProperty    0x656e626cL /* 'enbl' <CString> Enabling expression. */
  121. #define PIRequiredHostProperty    0x686f7374L /* 'host' <PIType> giving host required if any. */
  122. #define PICategoryProperty        0x63617467L /* 'catg' <PString> Category name that appears on top level menu. */
  123. #define PINameProperty            0x6e616d65L /* 'name' <PString> Menu name. */
  124. #define PIPickerIDProperty        0x706e6d65L    /* 'pnme' <CString> picker ID */
  125. #define PI68KCodeProperty        0x6d36386bL /* 'm68k' <PI68KCodeDesc> 68k code descriptor. See type below. */
  126. #define PI68KFPUCodeProperty    0x36386670L    /* '68fp' <PI68KCodeDesc> 68k w/FPU code descriptor. See type below. */
  127. #define PIPowerPCCodeProperty    0x70777063L /* 'pwpc' <PICFMCodeDesc> PowerPC code descriptor. See type below. */
  128. #define PIWin32X86CodeProperty  0x77783836L /* 'wx86' <PIWin32X86CodeDesc> Win32 Intel code descriptor. See type below */
  129. #define PIWin16X86CodeProperty  0x66783836L /* 'fx86' <PIWin16X86CodeDesc> Win16 Intel code descriptor. See type below */
  130.  
  131. #define PIUnixSPARCV7CodeProperty    0x75737037    /* 'usp7' SPARC version 7 */
  132. #define PIUnixSPARCV8CodeProperty    0x75737038    /* 'usp8' SPARC version 8 */
  133. #define PIUnixSPARCV9CodeProperty    0x75737039    /* 'usp9' SPARC version 9 */
  134. #define PIUnixSPARCCodeProperty    PIUnixSPARCV7CodeProperty
  135.  
  136. #define PIUnixMIPSR3000CodeProperty    0x756d7233    /* 'umr3' MIPS R3000 */
  137. #define PIUnixMIPSR4000CodeProperty    0x756d7234    /* 'umr4' MIPS R4000 */
  138. #define PIUnixMIPSR400064BitCodeProperty    0x756d3477    /* 'um4w' MIPS R4000 (can be 64 bit) */
  139. #define PIUnixMIPSR8000CodeProperty    0x756d7238    /* 'umr8' MIPS R8000 (always 64 bit) */
  140. #define PIUnixMIPSCodeProperty    PIUnixMIPSR3000CodeProperty
  141.  
  142. /********************************************************************************/
  143.  
  144. /* Structures that directly represent resources. */
  145.  
  146. #define kCurrentPiPLVersion 0
  147.  
  148. typedef struct PIProperty
  149.     {
  150.     PIType vendorID;        /* Vendor specific identifier. */
  151.     PIType propertyKey;        /* Identification key for this property type. */
  152.     int32  propertyID;        /* Index within this property type. Must be unique for properties of a given type in a PiPL. */
  153.     int32  propertyLength;    /* Length of following data array. Will be rounded to a multiple of 4. */
  154.     char   propertyData [1]; /* propertyLength bytes long. Must be a multiple of 4. Can be zero? */
  155.     } PIProperty;
  156.  
  157. typedef struct PIPropertyList
  158.     {
  159.     int32 version;            /* Properties datastructure version number. */
  160.     int32 count;            /* Number of properties contained. */
  161.     PIProperty properties[1];    /* The actual properties. */
  162.     } PIPropertyList;
  163.  
  164. typedef PIPropertyList **PIPropertyListHandle;
  165.  
  166. /* Below are structures describing types used in plug-in property lists.
  167.  * These structure obey Macintosh 68k alignment and padding rules though
  168.  * generally they are laid out so fields have natural alignment and any
  169.  * needed padding is explicit in the structure.
  170.  *
  171.  * In addition to these structure types, simple types such as int32, int16,
  172.  * etc. are used. Two other examples are PString and FlagSet. PString is like a
  173.  * rez pstring or a Str255 except that storage maynot be present for all
  174.  * 255 characters. The initial length byte is present in the property.
  175.  * FlagSet is a variable length bitstring in which the first member is
  176.  * represented by the most significant bit of the first byte, the eighth
  177.  * member is in the least significant bit of the first byte, etc. The length
  178.  * of the set is kept in the property's length field of course.
  179.  *
  180.  * Arrays are also used in places with bounds either taken from the
  181.  * property length or explicitly represented within the property.
  182.  */
  183.  
  184. typedef struct PI68KCodeDesc
  185.     {
  186.     PIType fType;
  187.     int16 fID;
  188.     } PI68KCodeDesc;
  189.  
  190. typedef struct PICFMCodeDesc
  191.     {
  192.     long fContainerOffset;
  193.     long fContainerLength;
  194.     unsigned char fEntryName[1];
  195.     } PICFMCodeDesc;
  196.     
  197. typedef struct PIWin32X86CodeDesc
  198. {
  199.     char fEntryName[1];
  200. } PIWin32X86CodeDesc;
  201.  
  202. typedef struct PIWin16X86CodeDesc
  203. {
  204.     char fEntryName[1];
  205. } PIWin16X86CodeDesc;
  206.  
  207. typedef struct TypeCreatorPair
  208.     {
  209.     PIType type;
  210.     PIType creator;
  211.     } TypeCreatorPair;
  212.  
  213. /********************************************************************************/
  214.  
  215. typedef struct PlugInInfo
  216.     {
  217.  
  218.     int16    version;            /* The version number of the interface supported. */
  219.     int16    subVersion;         /* The sub-version number.                          */
  220.     int16    priority;            /* The plug-in's priority.                        */
  221.     int16    generalInfoSize;    /* The size of the general info.                  */
  222.     int16    typeInfoSize;        /* The size of the type specific info.              */
  223.     int16    supportsMode;        /* A bit mask indicating supported image modes.   */
  224.     PIType    requireHost;        /* A required host if any.                          */
  225.  
  226.     }
  227. PlugInInfo;
  228.  
  229. #if PRAGMA_ALIGN_SUPPORTED
  230. #pragma options align=reset
  231. #endif
  232.  
  233. typedef struct PSBuffer *BufferID;
  234.  
  235. #define kPIGeneralInfoSize 16
  236.  
  237. /* Image modes */
  238.  
  239. #define plugInModeBitmap       0
  240. #define plugInModeGrayScale    1
  241. #define plugInModeIndexedColor 2
  242. #define plugInModeRGBColor       3
  243. #define plugInModeCMYKColor    4
  244. #define plugInModeHSLColor       5
  245. #define plugInModeHSBColor       6
  246. #define plugInModeMultichannel 7
  247. #define plugInModeDuotone       8
  248. #define plugInModeLabColor       9
  249. #define plugInModeGray16      10
  250. #define plugInModeRGB48          11
  251.  
  252. /* The Window procID for a Moveable Modal Dialog window that can be used
  253.  *    under System 6.  WDEF(128) is part of Photoshop.
  254.  */
  255.  
  256. #define PSmovableDBoxProc    (128*16+5)
  257.  
  258. /* Other commonly used structures */
  259.  
  260. typedef int16 PlaneMap [16];
  261.  
  262. typedef struct PlugInMonitor
  263.     {
  264.     Fixed gamma;
  265.     Fixed redX;
  266.     Fixed redY;
  267.     Fixed greenX;
  268.     Fixed greenY;
  269.     Fixed blueX;
  270.     Fixed blueY;
  271.     Fixed whiteX;
  272.     Fixed whiteY;
  273.     Fixed ambient;
  274.     }
  275. PlugInMonitor;
  276.  
  277. /* The following structures reflect the version 1 structure for PSPixelMaps. */
  278.  
  279. typedef struct PSPixelMask
  280.     {
  281.     struct PSPixelMask *next;
  282.     void *maskData;
  283.     int32 rowBytes;
  284.     int32 colBytes;
  285.     int32 maskDescription;
  286.     }
  287. PSPixelMask;
  288.  
  289. #define kSimplePSMask   0
  290. #define kBlackMatPSMask 1
  291. #define kGrayMatPSMask  2
  292. #define kWhiteMatPSMask 3
  293. #define kInvertPSMask   4
  294.  
  295. typedef struct PSPixelMap
  296.     {
  297.     int32 version;
  298.     VRect bounds;
  299.     int32 imageMode;
  300.     int32 rowBytes;
  301.     int32 colBytes;
  302.     int32 planeBytes;
  303.     void *baseAddr;
  304.     
  305.     /* Fields new in version 1. */
  306.     
  307.     PSPixelMask *mat;
  308.     PSPixelMask *masks;
  309.     int32 maskPhaseRow;    /* Used for setting the phase of the checkerboard. */
  310.     int32 maskPhaseCol;
  311.     }
  312. PSPixelMap;
  313.  
  314. typedef struct ColorServicesInfo
  315.     {
  316.     int32 infoSize;
  317.     int16 selector;
  318.     int16 sourceSpace;
  319.     int16 resultSpace;
  320.     Boolean resultGamutInfoValid;
  321.     Boolean resultInGamut;
  322.     void *reservedSourceSpaceInfo;     /* Must be NULL. (Will return paramErr if not.) */
  323.     void *reservedResultSpaceInfo;     /* Must be NULL. (Will return paramErr if not.) */
  324.     int16 colorComponents[4];
  325.     void *reserved;                     /* Must be NULL. (Will return paramErr if not.) */
  326.     union
  327.         {
  328.         Str255 *pickerPrompt;
  329.         Point *globalSamplePoint;
  330.         int32 specialColorID;
  331.         } selectorParameter;
  332.     }
  333. ColorServicesInfo;
  334.  
  335. /* Constants for resultSpace and sourceSpace fields. */
  336. #define plugIncolorServicesRGBSpace        0
  337. #define plugIncolorServicesHSBSpace        1
  338. #define plugIncolorServicesCMYKSpace    2
  339. #define plugIncolorServicesLabSpace        3
  340. #define plugIncolorServicesGraySpace    4
  341. #define plugIncolorServicesHSLSpace        5
  342. #define plugIncolorServicesXYZSpace        6
  343.  
  344. /* Only valid in the resultSpace field. Says leave the color in the space the user chose.
  345.  * Custom colors will be returned in an arbitrary space possibly depending on the book.
  346.  */
  347. #define plugIncolorServicesChosenSpace    -1
  348.  
  349. /* Used with the plugIncolorServicesGetSpecialColor selector. */
  350. #define plugIncolorServicesForegroundColor 0
  351. #define plugIncolorServicesBackgroundColor 1
  352.  
  353. /* Color Service Selectors. */
  354. #define plugIncolorServicesChooseColor        0
  355. #define plugIncolorServicesConvertColor        1        
  356. #define plugIncolorServicesSamplePoint        2
  357. #define plugIncolorServicesGetSpecialColor    3
  358.  
  359. /* The following images are used for the resampling callbacks. */
  360.  
  361. typedef struct PSImagePlane
  362.     {
  363.     void *data;
  364.     Rect bounds;
  365.     int32 rowBytes;
  366.     int32 colBytes;
  367.     }
  368. PSImagePlane;
  369.  
  370. /* Sorry about this, but to support more general pixel formats, here is yet
  371. another structure for describing areas of memory as pixels. The actual
  372. rectangle is expected to be given separately. */
  373.  
  374. typedef struct PixelMemoryDesc
  375.     {
  376.     void *data;
  377.     int32 rowBits;    /* Note bits not bytes! */
  378.     int32 colBits;    /* Note bits not bytes! */
  379.     int32 bitOffset;
  380.     int32 depth;
  381.     }
  382. PixelMemoryDesc;
  383.  
  384. /* We describe a scaling by providing two rectangles. */
  385.  
  386. typedef struct PSScaling
  387.     {
  388.     VRect sourceRect;
  389.     VRect destinationRect;
  390.     }
  391. PSScaling;
  392.  
  393. /* We provide access to internal channels via the following abstract types. */
  394.  
  395. typedef struct ChannelReadPortDesc *ChannelReadPort;
  396. typedef struct ChannelWritePortDesc *ChannelWritePort;
  397.  
  398. /* We describe a channel for reading with the following data structure. */
  399.  
  400. #define kCurrentMinVersReadChannelDesc    0
  401. #define kCurrentMaxVersReadChannelDesc    0
  402.  
  403. typedef struct ReadChannelDesc
  404.     {
  405.     
  406.     int32 minVersion;        /* The minimum and maximum version which */
  407.     int32 maxVersion;        /* can be used to interpret this record. */
  408.     
  409.     struct ReadChannelDesc *next;    /* The next descriptor in the list. */
  410.     
  411.     ChannelReadPort port;    /* The port to use for reading. */
  412.     
  413.     VRect bounds;            /* The bounds of the channel data. */
  414.     int32 depth;            /* The depth of the data. */
  415.     
  416.     VPoint tileSize;        /* The size of the tiles. */
  417.     VPoint tileOrigin;        /* The origin for the tiles. */
  418.     
  419.     Boolean target;            /* Is this a target channel. */
  420.     Boolean shown;            /* Is this channel shown? */
  421.     
  422.     int16 channelType;        /* The channel type. */
  423.     
  424.     void *contextInfo;        /* A pointer to additional info dependent on context. */
  425.     
  426.     const char *name;        /* The name of the channel. */
  427.     
  428.     }
  429. ReadChannelDesc;
  430.  
  431. /* We describe a document as a collection of lists of read channels. */
  432.  
  433. #define kCurrentMinVersReadImageDocDesc    0
  434. #define kCurrentMaxVersReadImageDocDesc    0
  435.  
  436. typedef struct ReadImageDocumentDesc
  437.     {
  438.     
  439.     int32 minVersion;        /* The minimum and maximum version which */
  440.     int32 maxVersion;        /* can be used to interpret this record. */
  441.     
  442.     /* Version 0 fields. */
  443.     
  444.     int32 imageMode;        /* The color mode for the document. */
  445.     
  446.     int32 depth;            /* The default depth for the document. */
  447.     
  448.     VRect bounds;            /* The bounds for the document. */
  449.     
  450.     Fixed hResolution;        /* The resolution for the document. */
  451.     Fixed vResolution;
  452.     
  453.     LookUpTable redLUT;        /* Color table for indexed color and duotone. */
  454.     LookUpTable greenLUT;
  455.     LookUpTable blueLUT;
  456.     
  457.     ReadChannelDesc *targetCompositeChannels;
  458.                             /* The composite channels in the target layer. */
  459.                             
  460.     ReadChannelDesc *targetTransparency;
  461.                             /* The transparency channel for the target layer. */
  462.                             
  463.     ReadChannelDesc *targetLayerMask;
  464.                             /* The layer mask for the target layer. */
  465.                             
  466.     ReadChannelDesc *mergedCompositeChannels;
  467.                             /* The composite channels in the merged data. */
  468.                             
  469.     ReadChannelDesc *mergedTransparency;
  470.                             /* The transparency channel for the merged data. */
  471.                             
  472.     ReadChannelDesc *alphaChannels;
  473.                             /* The alpha channels. */
  474.                             
  475.     ReadChannelDesc *selection;
  476.                             /* The selection mask if any. */
  477.     
  478.     }
  479. ReadImageDocumentDesc;
  480.  
  481. /* We provide a similar structure for accessing write channels. */
  482.  
  483. #define kCurrentMinVersWriteChannelDesc    0
  484. #define kCurrentMaxVersWriteChannelDesc    0
  485.  
  486. typedef struct WriteChannelDesc
  487.     {
  488.     
  489.     int32 minVersion;        /* The minimum and maximum version which */
  490.     int32 maxVersion;        /* can be used to interpret this record. */
  491.     
  492.     struct WriteChannelDesc *next;    /* The next descriptor in the list. */
  493.     
  494.     ChannelWritePort port;    /* The port to use for reading. */
  495.     
  496.     VRect bounds;            /* The bounds of the channel data. */
  497.     int32 depth;            /* The depth of the data. */
  498.     
  499.     VPoint tileSize;        /* The size of the tiles. */
  500.     VPoint tileOrigin;        /* The origin for the tiles. */
  501.     
  502.     int16 channelType;        /* The channel type. */
  503.     
  504.     int16 padding;            /* Reserved. Defaults to zero. */
  505.     
  506.     void *contextInfo;        /* A pointer to additional info dependent on context. */
  507.     
  508.     const char *name;        /* The name of the channel. */
  509.     
  510.     }
  511. WriteChannelDesc;
  512.  
  513. /* The channel types are covered by the following values. */
  514.  
  515. #define ctUnspecified         0
  516. #define ctRed                 1
  517. #define ctGreen                 2
  518. #define ctBlue                 3
  519. #define ctCyan                 4
  520. #define ctMagenta             5
  521. #define ctYellow             6
  522. #define ctBlack                 7
  523. #define ctL                     8
  524. #define ctA                     9
  525. #define ctB                    10
  526. #define ctDuotone            11
  527. #define ctIndex                12
  528. #define ctBitmap            13
  529. #define ctColorSelected        14
  530. #define ctColorProtected    15
  531. #define ctTransparency      16
  532. #define ctLayerMask         17
  533. #define ctInvertedLayerMask 18
  534. #define ctSelectionMask     19
  535.  
  536. #ifdef __cplusplus
  537.  
  538. extern "C"
  539.     {
  540. #endif
  541.  
  542.     typedef MACPASCAL Boolean (*TestAbortProc) (void);
  543.  
  544.     typedef MACPASCAL void (*ProgressProc) (int32 done, int32 total);
  545.  
  546.     typedef MACPASCAL void (*HostProc) (int16 selector, int32 *data);
  547.  
  548.     typedef MACPASCAL int32 (*SpaceProc) (void);
  549.  
  550.     typedef MACPASCAL Handle (*NewPIHandleProc) (int32 size);
  551.  
  552.     typedef MACPASCAL void (*DisposePIHandleProc) (Handle h);
  553.     
  554.     typedef MACPASCAL int32 (*GetPIHandleSizeProc) (Handle h);
  555.     
  556.     typedef MACPASCAL OSErr (*SetPIHandleSizeProc) (Handle h, int32 newSize);
  557.  
  558.     typedef MACPASCAL Ptr (*LockPIHandleProc) (Handle h, Boolean moveHigh);
  559.     
  560.     typedef MACPASCAL void (*UnlockPIHandleProc) (Handle h);
  561.  
  562.     typedef MACPASCAL void (*RecoverSpaceProc) (int32 size);
  563.  
  564.     typedef MACPASCAL OSErr (*AllocateBufferProc) (int32 size, BufferID *bufferID);
  565.  
  566.     typedef MACPASCAL Ptr (*LockBufferProc) (BufferID bufferID, Boolean moveHigh);
  567.  
  568.     typedef MACPASCAL void (*UnlockBufferProc) (BufferID bufferID);
  569.  
  570.     typedef MACPASCAL void (*FreeBufferProc) (BufferID bufferID);
  571.     
  572.     typedef MACPASCAL int32 (*BufferSpaceProc) (void);
  573.     
  574.     typedef MACPASCAL int16 (*CountPIResourcesProc) (ResType type);
  575.     
  576.     typedef MACPASCAL Handle (*GetPIResourceProc) (ResType type, int16 index);
  577.     
  578.     typedef MACPASCAL void (*DeletePIResourceProc) (ResType type, int16 index);
  579.     
  580.     typedef MACPASCAL OSErr (*AddPIResourceProc) (ResType type, Handle data);
  581.     
  582.     typedef MACPASCAL void (*ProcessEventProc) (void *event);
  583.     
  584.     typedef MACPASCAL OSErr (*DisplayPixelsProc) (const PSPixelMap *source,
  585.                                                   const VRect *srcRect,
  586.                                                   int32 dstRow,
  587.                                                   int32 dstCol,
  588.                                                   void *platformContext);
  589.                                             
  590.     typedef MACPASCAL OSErr (*AdvanceStateProc) (void);
  591.     
  592.     typedef MACPASCAL OSErr (*GetPropertyProc) (PIType signature,
  593.                                                 PIType key,
  594.                                                 int32 index,
  595.                                                 int32 *simpleProperty,
  596.                                                 Handle *complexProperty);
  597.  
  598.     typedef MACPASCAL OSErr (*SetPropertyProc) (PIType signature,
  599.                                                 PIType key,
  600.                                                 int32 index,
  601.                                                 int32 simpleProperty,
  602.                                                 Handle complexProperty);
  603.  
  604.     typedef MACPASCAL OSErr (*ColorServicesProc) (ColorServicesInfo *info);
  605.     
  606.     typedef MACPASCAL OSErr (*PIResampleProc) (PSImagePlane *source,
  607.                                                PSImagePlane *destination,
  608.                                                Rect *area,
  609.                                                Fixed *coords,
  610.                                                int16 method);
  611.                                                
  612.     typedef MACPASCAL OSErr (*ReadPixelsProc) (ChannelReadPort port,
  613.                                                const PSScaling *scaling,
  614.                                                const VRect *writeRect,
  615.                                                        /* Rectangle in destination coordinates. */
  616.                                                const PixelMemoryDesc *destination,
  617.                                                VRect *wroteRect);
  618.                                                
  619.     typedef MACPASCAL OSErr (*WriteBasePixelsProc) (ChannelWritePort port,
  620.                                                     const VRect *writeRect,
  621.                                                     const PixelMemoryDesc *source);
  622.                                                     
  623.     typedef MACPASCAL OSErr (*ReadPortForWritePortProc) (ChannelReadPort *readPort,
  624.                                                          ChannelWritePort writePort);
  625.     
  626. #ifdef __cplusplus
  627.     }
  628. #endif
  629.  
  630. #define kCurrentBufferProcsVersion 2
  631.  
  632. typedef struct BufferProcs
  633.     {
  634.  
  635.     int16 bufferProcsVersion;
  636.     
  637.     int16 numBufferProcs;
  638.  
  639.     AllocateBufferProc allocateProc;
  640.  
  641.     LockBufferProc lockProc;
  642.  
  643.     UnlockBufferProc unlockProc;
  644.  
  645.     FreeBufferProc freeProc;
  646.     
  647.     BufferSpaceProc spaceProc;
  648.  
  649.     }
  650. BufferProcs;
  651.  
  652. #define kCurrentBufferProcsCount \
  653.     ((sizeof(BufferProcs) - offsetof(BufferProcs, allocateProc)) / sizeof(void *)) 
  654.  
  655. #define kCurrentResourceProcsVersion 3
  656.  
  657. typedef struct ResourceProcs
  658.     {
  659.     
  660.     int16 resourceProcsVersion;
  661.     
  662.     int16 numResourceProcs;
  663.     
  664.     CountPIResourcesProc countProc;
  665.     
  666.     GetPIResourceProc getProc;
  667.     
  668.     DeletePIResourceProc deleteProc;
  669.     
  670.     AddPIResourceProc addProc;
  671.     
  672.     }
  673. ResourceProcs;
  674.  
  675. #define kCurrentResourceProcsCount \
  676.     ((sizeof(ResourceProcs) - offsetof(ResourceProcs, countProc)) / sizeof(void *)) 
  677.  
  678. /* Here are the resource types that have been reserved. */
  679.  
  680. #define kDayStarColorMatchingResource 'DCSR'
  681.  
  682.  
  683. #define kCurrentHandleProcsVersion 1
  684.  
  685. typedef struct HandleProcs
  686.     {
  687.     
  688.     int16 handleProcsVersion;
  689.     
  690.     int16 numHandleProcs;
  691.     
  692.     NewPIHandleProc newProc;
  693.     
  694.     DisposePIHandleProc disposeProc;
  695.     
  696.     GetPIHandleSizeProc getSizeProc;
  697.     
  698.     SetPIHandleSizeProc setSizeProc;
  699.     
  700.     LockPIHandleProc lockProc;
  701.     
  702.     UnlockPIHandleProc unlockProc;
  703.     
  704.     RecoverSpaceProc recoverSpaceProc;
  705.     
  706.     }
  707. HandleProcs;
  708.  
  709. #define kCurrentHandleProcsCount \
  710.     ((sizeof(HandleProcs) - offsetof(HandleProcs, newProc)) / sizeof(void *)) 
  711.  
  712. #define kCurrentImageServicesProcsVersion 1
  713.     
  714. typedef struct ImageServicesProcs
  715.     {
  716.     
  717.     int16 imageServicesProcsVersion;
  718.     int16 numImageServicesProcs;
  719.     
  720.     PIResampleProc interpolate1DProc;
  721.     PIResampleProc interpolate2DProc;
  722.     
  723.     }
  724. ImageServicesProcs;
  725.  
  726. #define kCurrentImageServicesProcsCount \
  727.     ((sizeof(ImageServicesProcs) - offsetof(ImageServicesProcs, interpolate1DProc)) / sizeof(void *)) 
  728.     
  729.  
  730. #define kCurrentPropertyProcsVersion 1
  731.  
  732. typedef struct PropertyProcs
  733.     {
  734.     
  735.     int16 propertyProcsVersion;
  736.     int16 numPropertyProcs;
  737.     
  738.     GetPropertyProc    getPropertyProc;
  739.     SetPropertyProc setPropertyProc;
  740.     
  741.     }
  742. PropertyProcs;
  743.  
  744. #define kCurrentPropertyProcsCount \
  745.     ((sizeof(PropertyProcs) - offsetof(PropertyProcs, getPropertyProc)) / sizeof(void *))
  746.  
  747. #define kCurrentChannelPortProcsVersion 1
  748.     
  749. typedef struct ChannelPortProcs
  750.     {
  751.     
  752.     int16 channelPortProcsVersion;
  753.     int16 numChannelPortProcs;
  754.     
  755.     ReadPixelsProc readPixelsProc;
  756.     WriteBasePixelsProc writeBasePixelsProc;
  757.     ReadPortForWritePortProc readPortForWritePortProc;
  758.     
  759.     }
  760. ChannelPortProcs;
  761.  
  762. #define kCurrentChannelPortProcsCount \
  763.     ((sizeof(ChannelPortProcs) - offsetof(ChannelPortProcs, readPixelsProc)) / sizeof(void *)) 
  764.     
  765.  
  766. /*********************************************************************************/
  767.  
  768. /* The following constants indicate what sort of padding to use.  Values 0
  769.    through 255 specify a constant value.  Negative values imply special
  770.    operations. */
  771.    
  772. #define plugInWantsEdgeReplication            -1
  773. #define plugInDoesNotWantPadding            -2
  774. #define plugInWantsErrorOnBoundsException    -3
  775.  
  776. /* If the plug-in does not want padding and does not want errors, then
  777.    exterior areas will contain arbitrary values. */
  778.  
  779. /*********************************************************************************/
  780.  
  781. /* The sampling flag indicates the level of sampling support. */
  782.  
  783. #define hostDoesNotSupportSampling        0
  784. #define hostSupportsIntegralSampling    1
  785. #define hostSupportsFractionalSampling    2
  786.  
  787. /*********************************************************************************/
  788.  
  789. /* Layout values for filters and export modules. */
  790.  
  791. #define piLayoutTraditional                0    /* Rows, columns, planes with colbytes = # planes */
  792. #define piLayoutRowsColumnsPlanes        1
  793. #define piLayoutRowsPlanesColumns        2
  794. #define piLayoutColumnsRowsPlanes        3
  795. #define piLayoutColumnsPlanesRows        4
  796. #define piLayoutPlanesRowsColumns        5
  797. #define piLayoutPlanesColumnsRows        6
  798.  
  799. /*********************************************************************************/
  800. typedef struct PIInterfaceColor
  801.     {
  802.     RGBtuple color32;     // interface color for full color depth
  803.     RGBtuple color2;     // interface color for B/W display
  804.     }
  805. PIInterfaceColor;
  806.  
  807. /*********************************************************************************/
  808.  
  809. // macros for interface color selectors
  810. #define kPIInterfaceButtonUpFill    1
  811. #define kPIInterfaceBevelShadow     2
  812. #define kPIInterfaceIconFillActive  3
  813. #define    kPIInterfaceIconFillDimmed  4
  814. #define    kPIInterfacePaletteFill     5
  815. #define    kPIInterfaceIconFrameDimmed 6
  816. #define    kPIInterfaceIconFrameActive 7
  817. #define    kPIInterfaceBevelHighlight  8
  818. #define    kPIInterfaceButtonDownFill  9
  819. #define    kPIInterfaceIconFillSelected    10
  820. #define kPIInterfaceBorder            11
  821. #define    kPIInterfaceButtonDarkShadow     12
  822. #define    kPIInterfaceIconFrameSelected     13
  823. #define    kPIInterfaceRed                14
  824.  
  825. /*********************************************************************************/
  826.  
  827.  
  828. #if defined(__BORLANDC__)
  829. #pragma option -a.
  830. #endif
  831.  
  832. #endif
  833.  
  834.